/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI;

//import Model.EnigmaModel;
import Model.GameStateListener;
import java.awt.image.BufferedImage;

/**
 *
 * @author Snowangelic
 */
public class GameStateView implements GameStateListener {

    Layer informationLayer;
    BufferedImage playerLostImage;
    BufferedImage playerWonImage;
    BufferedImage gamePausedImage;
    BufferedImage gameNotYetStartedImage;
    BufferedImage gameReadyImage;

    //BufferedImage gameIsPlayingImage;

    public GameStateView(Layer myLayer){
        informationLayer=myLayer;
        playerLostImage=EnigmaUtils.ImageLoader.loadImage("./images/playerLost.png");
        playerWonImage=EnigmaUtils.ImageLoader.loadImage("./images/playerWon.png");
        gamePausedImage=EnigmaUtils.ImageLoader.loadImage("./images/gamePaused.png");
        gameNotYetStartedImage=EnigmaUtils.ImageLoader.loadImage("./images/gameNotStarted.png");
        gameReadyImage=EnigmaUtils.ImageLoader.loadImage("./images/gameReady.png");
    }

    public void gameStateChanged(int newGameState) {
        if(newGameState==0)
            informationLayer.addLayerEvent(new LayerEvent(0,0,gameNotYetStartedImage));

        else if(newGameState==1)
            informationLayer.addLayerEvent(new LayerEvent(0,0,new BufferedImage(640,480,BufferedImage.TYPE_INT_ARGB)));

        else if(newGameState==2)
            informationLayer.addLayerEvent(new LayerEvent(0,0,gamePausedImage));

        else if(newGameState==3)
            informationLayer.addLayerEvent(new LayerEvent(0,0,playerWonImage));

        else if(newGameState==4)
            informationLayer.addLayerEvent(new LayerEvent(0,0,playerLostImage));

        else if(newGameState==5)
            informationLayer.addLayerEvent(new LayerEvent(0,0,gameReadyImage));
    }

}
